import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/Index'

Vue.use(Router)

export default new Router({
  //  tomcat部署需要添加 base字段
  routes: [
    {
      path: '/',
      base: '/pos',
      name: 'Index',
      component: Index,
      children: [
        {
          path: '/main',
          component: () => import('../components/admin/Main.vue')
        },
        {
          path: '/deploy',
          component: () => import('../components/admin/Deploy.vue')
        },
        {
          path: '/deviceManager',
          component: () => import('../components/admin/DeviceManager.vue')
        },
        {
          path: '/globalConfig',
          component: () => import('../components/admin/GlobalConfig.vue')
        },
        {
          path: '/refund',
          component: () => import('../components/admin/Refund.vue')
        },
        {
          path: '/task',
          component: () => import('../components/admin/Scheduler.vue')
        }
      ]
    }
  ]
})
